package com.serkol.driving.learning.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.serkol.bean.MyPage;
import com.serkol.driving.learning.entity.Language;
import com.serkol.driving.learning.mapper.LanguageMapper;
import com.serkol.driving.learning.service.LanguageService;
import org.springframework.stereotype.Service;

/**
 * @author pingan
 * @description 针对表【language】的数据库操作Service实现
 * @createDate 2022-06-07 00:16:41
 */
@Service
public class LanguageServiceImpl extends ServiceImpl<LanguageMapper, Language>
        implements LanguageService {

    @Override
    public MyPage findByList(int pageSize, int current) {
        QueryWrapper<Language> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByDesc("ID");
        Page<Language> page = new Page<>(current, pageSize);
        IPage<Language> loginLogPage = this.baseMapper.selectPage(page, queryWrapper);
        return MyPage.parsePage(loginLogPage);
    }
}




